package com.mall.order.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@TableName("`order`")
public class Order {
    @TableId(value = "order_id", type = IdType.NONE)
    private Long id;  //  主键

    private String orderNo;  // 订单号

    private Long userId;  // 用户ID
    private BigDecimal totalAmount;  // 总金额
    private BigDecimal payAmount;  //实付金额
    private BigDecimal freightAmount;  // 运费金额
    private Integer status; // 0:待支付, 1:已支付, 2:已取消, 3:已完成

    private LocalDateTime payTime;  // 支付时间
    private LocalDateTime cancelTime;  // 关闭时间
    private LocalDateTime receiveTime;  // 发货时间

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;  // 创建时间

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;  // 更新时间
}